#include "SNCascadeBoostParams.h"
//-----------------------------------------------------------
SNCascadeBoostParams::SNCascadeBoostParams()
{
}
//-----------------------------------------------------------

SNCascadeBoostParams::SNCascadeBoostParams(int boost_type, float min_hit_rate, float max_false_alarm, double weight_trim_rate, int max_depth, int max_weak_count)
{

}
//-----------------------------------------------------------

SNCascadeBoostParams::~SNCascadeBoostParams()
{
}

bool SNCascadeBoostParams::ScanAttr(const QString prm_name, const QString val)
{
	bool res = true;

	if (!prm_name.compare("-bt"))
	{
		boost_type = !val.compare("DAB") ? CvBoost::DISCRETE :
			!val.compare("RAB") ? CvBoost::REAL :
			!val.compare("LB") ? CvBoost::LOGIT :
			!val.compare("GAB") ? CvBoost::GENTLE : -1;

		if (boost_type == -1)
			res = false;
	}
	else 
	if (!prm_name.compare("-minHitRate"))
	{
		MinHitRate = val.toFloat();
	}
	else 
	if (!prm_name.compare("-maxFalseAlarmRate"))
	{
		MaxFalseAlarm = val.toFloat();
	}
	else 
	if (!prm_name.compare("-weightTrimRate"))
	{
		weight_trim_rate = val.toDouble();
	}
	else 
	if (!prm_name.compare("-maxDepth"))
	{
		max_depth = val.toInt();
	}
	else 
	if (!prm_name.compare("-maxWeakCount"))
	{
		weak_count = val.toInt();
	}
	else
	{
		res = false;
	}
	
	return res;
}
//-----------------------------------------------------------
